import request from '@/utils/request'

// 获取角色列表
export const getroleList = params => request({
  url: '/roles',
  // headers: {
  //   Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NTYsImlhdCI6MTY1NjA1NTAxOCwiZXhwIjoxNjU4NjQ3MDE4fQ.Y1DP09XJG_jX7iePtlQ-Ijs_2TwZ5TlQTW2YuaLKNHA'
  // },
  params
})

// 获取角色数量
export const getroleNumber = () => request({
  url: '/roles/count'
})

// 新增角色
export const addRole = data => request({
  url: '/roles',
  method: 'post',
  data
})

// 删除角色
export const delRole = id => request({
  url: '/roles/' + id,
  method: 'delete'
})

// 根据id获取角色信息
export const getRoledetail = id => {
  return request({
    url: '/roles/' + id
  })
}

// 根据id修改角色信息
export const editRoledetail = data => request({
  url: '/roles/' + data.id,
  method: 'put',
  data
})

